/*
 * PayOff.cpp
 *
 *  Created on: Nov 7, 2009
 *      Author: karthik
 */
#include "PayOff.h"
#include<iostream>

double PayOff::getPayOff(double* underlying_prices, int n){
	double mean = 0.0;
	for (int i=0;i<n;i++){
//		std::cout<<underlying_prices[i]<<std::endl;
		mean += underlying_prices[i];
	}
	mean /= n;
//	std::cout<<"mean : "<<mean<<std::endl;
	return (mean>this->strike?mean-this->strike:0.0);
}
